<?

function send_email_local($email, $subject, $text, $from='From Name'){
	if ($text==strip_tags($text)) $text=format($text);
	$head="MIME-Version: 1.0\r\nContent-type: text/html; charset=utf-8\r\nFrom: ".$from."\r\n";
	return mail($email, $subject, $text, $head);
}


function send_email($email, $subject, $text, $from='From Name'){
	require_once('class.phpmailer.php');
	$mail = new PHPMailer();
	$mail->Mailer = 'smtp';	
	$mail->CharSet = 'utf-8';
	$mail->IsHTML(true);
	$mail->From = $from; 
	$mail->FromName = $from;
	
	$mail->Subject = $subject;
	$mail->Body = $text;
	//if (is_uploaded_file($_FILES[attachment][tmp_name])) $mail->AddAttachment($_FILES[attachment][tmp_name], $_FILES[attachment][name]);

	$mail->AddAddress($email);
	if(!$mail->Send()){ /*echo 'Mailer Error: ' . $mail->ErrorInfo;*/ return false; }
	else return true;	
}


?>